/*
 * 
 * Copyright 2011 visual-analysis-of-cancer.
 * This file is part of visual-analysis-of-cancer.
 * 
 * visual-analysis-of-cancer is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * visual-analysis-of-cancer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with kOSMik.  If not, see <http://www.gnu.org/licenses/>.
 *  
 * visual-analysis-of-cancer:
 * An tool to analye the WHO and GLOBOCAN cancer data.
 * http://code.google.com/p/visual-analysis-of-cancer/
 * 
 * 
 * 
 * Authors: Erik Sniegula, Johannes Dahlke
 * 
 * Module:  Programming in Processing for Visual Analytics
 * Group:   20
 * 
 * Created: Aug. 2011
 * Version: 1.0
 *
 */
 




package de.fuberlin.processing.who.cancer.utils;

import controlP5.ControlP5;
import processing.core.PFont;


public class Fonts {
	
	private static PFont fontTimes;
	private static PFont fontPurisaBold;
	private static PFont fontArialBold;
	private static PFont fontDejavuSans;
	
	public static void init() {
	  loadFonts();	
	}
	
	private static void loadFonts() {
		fontTimes = ControlP5.papplet.loadFont( "TimesNewRomanPSMT-10.vlw");
		fontPurisaBold = ControlP5.papplet.loadFont( "Purisa-Bold-48.vlw");
		fontArialBold = ControlP5.papplet.loadFont( "Arial-BoldMT-14.vlw");
		fontDejavuSans = ControlP5.papplet.loadFont( "DejaVuSans-10.vlw");
	}
	
	public static PFont getArialBold() {
		if ( Test.isUnassigned( fontArialBold))
			loadFonts();
		return fontArialBold;
	}
	
	public static PFont getPurisaBold() {
		if ( Test.isUnassigned( fontPurisaBold))
			loadFonts();
		return fontPurisaBold;
	}
	
	public static PFont getTimes() {
		if ( Test.isUnassigned( fontTimes))
			loadFonts();
		return fontTimes;
	}
	
	public static PFont getDejavuSans() {
		if ( Test.isUnassigned( fontDejavuSans))
			loadFonts();
		return fontDejavuSans;
	}
}
